<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
	String contextPath = request.getContextPath();
%>  
<form action="<%=contextPath %>/successBoard/list.do" name="search" method="get" onsubmit="return searchCheck()">
<!-- //Wrapper -->
<div id="wrapper">	
<!-- Contenter_Sub -->
<div id="container_sub">
<!-- Content_List -->
<div id="sub_page_bg4"></div>
<!-- Sub Page Background -->
		
<div id="content_list">
<div class="title">
						
<div class='sub_title'>
<li>성혼후기</li>
<li class='stitle'>나의 성공담!</li>
</div>

<div class='navig'>
	<li class='frst'><img src='../image/all/home_icon.png' align='absmiddle' width='13' height='13'><a href='<%=contextPath %>/main/index.do'>HOME</a></li>
	<li>후기&문의</li>
	<li>성혼 후기</li>
</div>

<!-- sub_menu-->
<ul class='sub_menu'>		
	<ul class="sub_tab">
		<li><a class='rollover' href="<%=contextPath%>/mainPage/query.do">FAQ</a></li>
		<li><a class='rollover' href="<%=contextPath %>/qnaBoard/list.do">1:1문의하기</a></li>
		<li><a class='over' href="#">성혼 후기</a></li>
	</ul>
</ul>
			
<!-- class title div끝 -->
</div>

	
<!-- 게시판 목록 시작 { -->
<style>
	ul,ol,li {list-style:none;}
	li {display:inline;}
</style>
<div id="bo_list">
    
    <!--총 글건수랑 현재 페이지-->
    <div class="bo_fx">
        <div id="bo_list_total">
            <span>Total${count}건</span>
            ${currentPage}페이지 
        </div>
            <ul class="btn_bo_user" style="float:right">
            <li><a href="<%=contextPath %>/successBoard/write.do" class="btn_b02">글쓰기</a></li>        </ul>
        
     </div>
     

    
    <!-- 본격적인 게시판 리스트 -->
 <div class="tbl_head01 tbl_wrap">
    <table>
    <caption>리얼후기 목록</caption>
     <thead>
      <tr>
        <th scope="col" class="td_num">번호</th>
        <th scope="col">제목</th>
        <th scope="col" class="td_name sv_use">글쓴이</th>
        <th scope="col" class="td_date">날짜</th>
        <th scope="col" class="td_num">조회</th>
      </tr>
     </thead>
     
     <tbody>
      <c:forEach var="article" items="${list}">
      <tr>
      <c:if test="${article.reply_step == 0}">
        <td class="td_num">${article.num}<c:set var="number" value="${article.num}"/></td>
      </c:if>
      <c:if test="${article.reply_step != 0}">
      	<td class="td_num"></td> 
      </c:if>
        
        <td class="td_subject"> 
        <c:choose>			
				<c:when test="${article.reply_step != 0}"><!-- 게시글이 덧글일 경우 -->
					<c:forEach var="i" begin="1" end="${article.reply_level}" step="1"><!-- 레벨의 수만큼 글을 뒤로 민다 -->
						&nbsp;&nbsp;&nbsp;->
					</c:forEach>
						<a href="detail.do?num=${article.num}" ><img src="../image/all/icon_text.png" alt="비밀글">
           				 ${article.title}</a>
           				 <c:if test="${article.write_type== 2 }">
						 <img src="http://www.wedaehan.com/skin/board/basic2/img/icon_secret.gif" alt="비밀글"></c:if>
           				 <c:if test="${article.read_count==0 }">
           				 <img src="http://www.wedaehan.com/skin/board/basic2/img/icon_new.gif" alt="새글"></c:if>
            			 <c:if test ="${article.read_count>15 }">
            			 <img src="http://www.wedaehan.com/skin/board/after/img/icon_hot.gif" alt="인기글"></c:if>
						<!-- 마우스를 올리면 게시물 번호에 따른 showlayer(게시물 미리보기 창)가 실행됨 -->
				</c:when>
				<c:when test="${article.reply_step == 0}">
					<c:if test ="${(id =='admin' or article.id == id) and article.write_type==2}"><a href="detail.do?num=${article.num}" >${article.title}</a></c:if>
						<c:if test ="${(id !='admin' and article.id != id) and article.write_type==2}"><a href="<%=contextPath%>/successBoard/list.do" onclick="alert('비밀글입니다.')">${article.title}</a></c:if>
						<c:if test ="${article.write_type==1}"><a href="detail.do?num=${article.num}" >${article.title}</a></c:if>
							 
						 <c:if test="${article.write_type== 2 }">
						 <img src="http://www.wedaehan.com/skin/board/basic2/img/icon_secret.gif" alt="비밀글"></c:if>
            			 <c:if test="${article.read_count==0 }">
            			 <img src="http://www.wedaehan.com/skin/board/basic2/img/icon_new.gif" alt="새글"></c:if>
            			 <c:if test ="${article.read_count>15 }">
      			         <img src="http://www.wedaehan.com/skin/board/after/img/icon_hot.gif" alt="인기글"></c:if>				
				</c:when>
			</c:choose>
        </td>
        
        <td class="td_name sv_use"><span class="sv_member">${article.writer_name}</span></td>
        <td class="td_date"><fmt:formatDate value="${article.posting_date}" pattern="MM-dd"/></td>
        <td class="td_num">${article.read_count}</td>
      </tr>
       </c:forEach>
       
      <c:if test="${count == 0}">
      <tr>
		<td colspan="5" class="align-center">등록된 게시물이 없습니다.</td>
	  </tr>
	   </c:if>
     </tbody>
   </table>
</div>
 <div class="bo_fx">
     <ul class="btn_bo_user" style="float:right">
      <li><a href="<%=contextPath %>/successBoard/write.do" class="btn_b02">글쓰기</a></li>        </ul>
 </div>

</div>

<!-- 페이징처리 -->
<table>
<c:if test="${count > 0}">
<nav class="pg_wrap">

	<span class="pg">
	${pagingHtml} </span>
	
</nav>
</c:if>
</table>
<!-- 게시판 검색 시작 { -->
<fieldset id="bo_sch" >
    <legend>게시물 검색</legend>
	<!-- 히든값뭔지몰라서주석 -->
      <label for="sfl" class="sound_only">검색대상</label>
    
  <select name="keyField" id="sfl">
        <option value="all">전체</option> 
        <option value="title">제목</option>
        <option value="writer">글쓴이</option>  
        </select>
   <label for="stx" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
   <input type="text" name="keyWord" value="" required id="stx"  class="frm_input required" size="15" maxlength="15">
   <input type="submit" value="검색" class="btn_submit">
</fieldset>
		<!-- <div id="blank">&nbsp;</div> -->
		</div>
		<!-- //content_list -->

	</div>
	<!-- //contenter_sub -->

</div>
<!-- //wrapper -->

<hr>
</form>
